---------------------------------------------------------------
File name   :  vv_ahblite_slave.e
Title       :  The slave implementation.
Project     :  vv_ahblite UVC
Developers  :  stefan,filip
Created     :  3.08.2011.
Description :  This file implements the slave unit.
Notes       :  
---------------------------------------------------------------
Copyright  (c)2011
---------------------------------------------------------------

<'
package vv_ahblite;

extend vv_ahblite_slave {


    -- This method returns TRUE if the received address is within
    -- the slave address range (as defined by min_addr and
    -- max_addr).
    package in_range(addr : vv_ahblite_addr_t) : bool is {
        result = (addr >= min_addr) and (addr <= max_addr);
    }; --@@@@ will be replaced with decoder 
    
    -- Ensure that the slave monitor gets rerun when reset is asserted
    -- during the test.
    reset_start() is also {
        message(LOW,"Start Reset slave agent...");
        --agent_monitor.reset_start();
    };
    
    reset_end() is also {
        message(LOW,"End Reset slave agent...");
        --agent_monitor.reset_end();
    };
    
    when ACTIVE vv_ahblite_slave {
    
        -- Ensure that the slave driver and BFM get rerun when reset is asserted
        -- during the test.
        reset_start() is also {
            driver.rerun();
            bfm.reset_start();
        };
    
        reset_end() is also {
            bfm.reset_end();
        };
    
        -- Emit the driver clock
        on clk {
            emit driver.clock;
        };
    };
      
};

'>
